//
//  ViewController.m
//  ImageTurnPDF
//
//  Created by 向祖华 on 16/4/1.
//  Copyright © 2016年 向祖华. All rights reserved.
//

#import "ViewController.h"
#import "ImageTurnPDFMode.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //创建一个装图片的数组
    NSArray * imageArr = @[[UIImage imageNamed:@"1"],[UIImage imageNamed:@"2"],[UIImage imageNamed:@"3"],[UIImage imageNamed:@"4"],[UIImage imageNamed:@"5"],[UIImage imageNamed:@"6"],[UIImage imageNamed:@"7"],[UIImage imageNamed:@"8"]];
    //创建一个文件名
    NSString* fileNameStr = @"imagePDF";
    //创建一个webview
    UIWebView * webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    [self.view addSubview:webview];
    //将图片转换成PDF
    ImageTurnPDFMode * imageTurnPDFMode = [[ImageTurnPDFMode alloc]init];
    [imageTurnPDFMode creatPDFWithImageArr:imageArr fileName:fileNameStr orientation:horizontal];//横向vertical
    //将PDF文件
    [imageTurnPDFMode showPDFInWebview:webview fileName:fileNameStr];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

@end
